package cn.yqn.feign;

import cn.yqn.fallback.MovieFeignServiceFallbackFatory;
import cn.yqn.result.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(value = "service-movie", fallbackFactory = MovieFeignServiceFallbackFatory.class)
@RequestMapping("/movieTicket")
public interface MovieFeignService {

    /**
     * 查询所有对象
     */
    @RequestMapping(value = "/list",method = RequestMethod.GET)
    JsonResult list();

    /**
     * 查询所有对象
     */
    @GetMapping("/buy/{userId}/{movieId}")
    JsonResult buy(@PathVariable("userId") Long userId, @PathVariable("movieId") Long movieId);

    /**
     * 查询所有对象
     */
    @GetMapping("/watch/{userId}/{movieId}")
    JsonResult watch(@PathVariable("userId") Long userId, @PathVariable("movieId") Long movieId);

}
